<? session_start();
include("conex.php");
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Bootstrap, from Twitter</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
    <link href="../bootstrap/bootstrap/css/bootstrap.css" rel="stylesheet">
    <style type="text/css">
      body {
        padding-top: 60px;
        padding-bottom: 40px;
      }
    </style>
    <link href="../bootstrap/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- Le fav and touch icons -->
    <link rel="shortcut icon" href="../bootstrap/bootstrap/ico/favicon.ico">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../bootstrap/bootstrap/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../bootstrap/bootstrap/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../bootstrap/bootstrap/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="../bootstrap/bootstrap/ico/apple-touch-icon-57-precomposed.png">
  </head>

  <body>

    <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <a class="brand" href="#">Project name</a>
          <div class="nav-collapse collapse">
            <ul class="nav">
              <li class="active"><a href="#">Home</a></li>
              <li><a href="#about">About</a></li>
              <li><a href="#contact">Contact</a></li>
              <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
                <ul class="dropdown-menu">
                  <li><a href="#">Action</a></li>
                  <li><a href="#">Another action</a></li>
                  <li><a href="#">Something else here</a></li>
                  <li class="divider"></li>
                  <li class="nav-header">Nav header</li>
                  <li><a href="#">Separated link</a></li>
                  <li><a href="#">One more separated link</a></li>
                </ul>
              </li>
            </ul>
            <?
			if($_GET['dis']==1){
				
			unset($_SESSION['nombre']);
			unset($_SESSION['grupo']);
			session_destroy();
			}
			 if ($_POST['email']){
				 $query="select * from Usuarios where email='".$_POST['email']."' and password =	'".$_POST['password']."'";
				$result=mysql_query($query);
				if(mysql_num_rows($result)>0){
					
					$fila=mysql_fetch_object($result);
					$_SESSION['nombre']=$fila->nombre." ".$fila->apellidos;
					$_SESSION['grupo']=$fila->grupo;
				}
				else{
					echo "usuario o contraseña erronea";	
				}
			}
			if (!isset($_SESSION['nombre'])){
			?>
            <form action="" class="navbar-form pull-right" method="post">
              <input class="span2" type="text" placeholder="Email" name="email">
              <input class="span2" type="password" placeholder="Password" name="password">
              <button type="submit" class="btn">Sign in</button>
            </form>
            <?
			}
			else{
				
				echo "<div> <a href='index.php?dis=1' class='btn btn-small btn-danger'> Desconectar ".strtoupper($_SESSION['nombre'])." </a></div>";
			}
			?>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>

    <div class="container">
<? if (!isset($_SESSION['nombre'])){ ?>
      <!-- Main hero unit for a primary marketing message or call to action -->
      <div class="hero-unit">
        <h1>Hello, world!</h1>
        <p>This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
        <p><a class="btn btn-primary btn-large">Learn more &raquo;</a></p>
      </div>

<? }else{ ?>

<div class="hero-unit">
        <h1>Nuevos Procesos</h1>
        <p>tabla con los nuevos procesos que puedes crear</p>
        <p><a class="btn btn-primary btn-large">Learn more &raquo;</a></p>
      </div>
      
      <div class="hero-unit">
        <h1>Procesos Pendientes</h1>
        <p>Tabla con los procesos pendientes</p>
        <p><a class="btn btn-primary btn-large">Learn more &raquo;</a></p>
      </div>
      

<? } ?>
      <hr>

      <footer>
        <p>&copy; PFC  Miguel, Pascual, Jose Miguel</p>
      </footer>

    </div> <!-- /container -->

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="../bootstrap/bootstrap/js/jquery.js"></script>
    <script src="../bootstrap/bootstrap/js/bootstrap-transition.js"></script>
    <script src="../bootstrap/bootstrap/js/bootstrap-alert.js"></script>
    <script src="../bootstrap/bootstrap/js/bootstrap-modal.js"></script>
    <script src="../bootstrap/bootstrap/js/bootstrap-dropdown.js"></script>
    <script src="../bootstrap/bootstrap/js/bootstrap-scrollspy.js"></script>
    <script src="../bootstrap/bootstrap/js/bootstrap-tab.js"></script>
    <script src="../bootstrap/bootstrap/js/bootstrap-tooltip.js"></script>
    <script src="../bootstrap/bootstrap/js/bootstrap-popover.js"></script>
    <script src="../bootstrap/bootstrap/js/bootstrap-button.js"></script>
    <script src="../bootstrap/bootstrap/js/bootstrap-collapse.js"></script>
    <script src="../bootstrap/bootstrap/js/bootstrap-carousel.js"></script>
    <script src="../bootstrap/bootstrap/js/bootstrap-typeahead.js"></script>

  </body>
</html>